package myApp.KnorrAndroid.controller;

import myApp.Constant.ErrorConstants;
import myApp.KnorrAndroid.common.ActionEvent;
import myApp.KnorrAndroid.common.ModelEvent;

public abstract class AbstractController {
	// trace log xuong server
	//public LogMsg log;
	abstract public void handleViewEvent(ActionEvent e);
    abstract public void handleModelEvent(ModelEvent modelEvent);
    abstract public void handleSwitchActivity(ActionEvent e);
    
    public void handleErrorModelEvent(final ModelEvent modelEvent) {
	}
    
    public void handleCommonError(ModelEvent modelEvent){    	
    	ActionEvent actionEvent = modelEvent.getActionEvent();
    	switch(modelEvent.getModelCode()){
    	case ErrorConstants.ERROR_SESSION_RESET:
    		actionEvent.controller = this;
    		break;
    	}
    }
}
